<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
	<head>
		<base href="<%=basePath%>">
		<title>分店信息修改</title>
		<%@include file="../collect/meta.jsp"%>
		<style type="text/css">
			.input {
				width: 160px;
				height: 28px;
				font-size: 15px
			}
			
			.tbinput {
				width: 180px;
				height: 28px;
				font-size: 15px;
				background-color: #FFFFCC
			}
			
			.error {
				color: red
			}
			
			.success {
				color: green
			}
		</style>
		<link rel="stylesheet" href="css/radius.css" type="text/css"></link>
		<script type="text/javascript" src="${ctx}/js/returnTop.js"></script>
	</head>
	<body lang="zh-cn">
		<div class="wrapper">
			<c:import url="/muser/musertop.jsp"></c:import>
			<div class="main-container" id="main-container">
				<div class="main-container-inner">
					<c:import url="/muser/muserleft.jsp"></c:import>
					<div class="main-content">
						<div class="breadcrumbs" id="breadcrumbs">
							<ul class="breadcrumb">
								<li><i class="icon-home home-icon"></i>分店信息</li>
							</ul>
						</div>
						<div class="page-content">
							<div class="row">
								<div class="col-xs-12">
										<!-- PAGE CONTENT BEGINS -->
										<form action="muser!updateMessage" name="updatewx"
											method="post">
											<div align="center">
												<table>
													<tr>
														<td height="60">&nbsp;</td>
														<td height="60"><div align="right"><strong>登陆账号：&nbsp;</strong></div></td>
														<td><input type="text" id="userMobile" name="user.mobile" class="input" value="${user.mobile}"></td>
														<td><br></td>
													</tr>
													<tr>
														<td height="60">&nbsp;</td>
														<td height="60">
															<div align="right">
																<strong>分店地址：&nbsp;</strong>
															</div>
														</td>
														<td>
															<input type="text" id="shopAddress"name="user.shop.address" class="input"value="${user.shop.address}">
														</td>
														<td><br></td>
													</tr>
													<tr >
														<td height="60" colspan="2">
															<input type="hidden" name="user.id" id="userId" value="${user.id}">
														</td>
														<td colspan="2">
															<div align="left">
																<input type="button" class="btn btn-primary radius" id="but"value="修改">															
															</div>
														</td>
													</tr>
													<tr >
														<td height="60" colspan="4">
															<font style="color: red; font-size: 25px;">${result }</font>
														</td>
													</tr>
												</table>
											</div>
										</form>
										<!-- PAGE CONTENT ENDS -->
									</div>
									<!-- /.col -->
								</div>
							</blockquote>
							<!-- /.row -->
						</div>
						<!-- /.page-content -->
					</div>
					<!-- /.main-content -->
				</div>
				<!-- /.main-container-inner -->
				<a href="#" id="btn-scroll-up"
					class="btn-scroll-up btn btn-sm btn-inverse"
					style="position: fixed; bottom: 0;"> <i
					class="icon-double-angle-up icon-only bigger-110"></i> </a>
			</div>
			<!-- /.main-container -->
			<div class="push"></div>
		</div>
		<c:import url="/collect/down.jsp"></c:import>

		<script type="text/javascript">
	$("#but").click(function() {
		var userMobile= $("input[id='userMobile']").val();

		if (userMobile.length == 0) {
			alert("登陆账号必填");
			return false;
		}
		
		$.ajax( {
			async : false,
			url : "muser!checkUpdateMessage",
			type : "post",
			data : {
				"userMobile" : userMobile,
				"userId" : $("#userId").val()
			},
			datatype : "json",
			success : function(data) {

				var d = eval("(" + data + ")");

				var b = d.check;
				var message = d.message;
				if (!b) {
					alert(message);
				} else {
					updatewx.submit();
				}
			},
			error : function(request) {
				alert("Connection error");
			}
		});

	});
	
	
</script>
	</body>
</html>